package scantask.client.connection;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import scantask.containers.operationStanzas.Stanza;
import scantask.server.connection.ConnectionHundler;

public class ClientConnectionHundler {
	
	private ConnectionHundler _serverConnectionHundler;
	
	public ClientConnectionHundler() {
		this._serverConnectionHundler = new ConnectionHundler();
	}
	
	public String performOperation(Stanza operationStanza) {
		return this._serverConnectionHundler.doOperation(this.parse(operationStanza));
	}
	
	private String parse(Stanza operation) {
		XStream xstream = new XStream(new DomDriver());
		return xstream.toXML(operation);
	}

}
